package com.project.bookstore.search.repo;

import com.project.bookstore.book.pojo.BookDetailVO;
import com.project.bookstore.search.BookSearch;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

public interface BookRepository extends ElasticsearchRepository<BookSearch,Long> {
    //根据书名查询
    Iterable<BookSearch> queryBookSearchByBookNameMatches(String bookName);

    //根据书名或作者查询,按价格排序
    Iterable<BookSearch> queryBookSearchByBookNameMatchesOrAuthorMatchesOrderByPriceDesc(String bookName,String author);

    //分页查询
    //根据书名或作者查询,按价格排序
    Page<BookSearch> queryBookSearchByBookNameMatchesOrAuthorMatchesOrderByPriceDesc(String bookName, String author, Pageable pageable);
}
